JavaScript

A5.u.svgarc Method

Syntax

A5.u.svg.arc(layout,settings)

A5.u.svg.arc(type,layout,settings)

Returns

pathstringobject

The SVG path definition for the given arc or object with extended information.

pathstring

The SVG path definition for the given arc.

typestring

The type of layout used.

angleobject

The angles used.

startnumber

The start angle of the arc.

endnumber

The end angle of the arc.

midnumber

The angle half way between the start and end angles of the arc.

radiusobject

The radii used.

outernumber

The outer radius of the arc.

innernumber

The inner radius of the arc.

midnumber

The radius half way between the inner and outer radii of the arc.

pointsobject

The points used.

outerobject

The outer radius points.

startarray

The X/Y coordinates of the outer start point.

endarray

The X/Y coordinates of the outer end point.

midarray

The X/Y coordinates of the outer mid point.

midobject

The mid radius points.

startarray

The X/Y coordinates of the mid radius start point.

endarray

The X/Y coordinates of the mid radius end point.

midarray

The X/Y coordinates of the mid radius mid point.

innerobject

The inner radius points.

startarray

The X/Y coordinates of the inner start point.

endarray

The X/Y coordinates of the inner end point.

midarray

The X/Y coordinates of the inner mid point.

errorstringboolean

Any errors encountered.

typestring

The typeof of the layout to use. Values can be "3-point-intersect", "3-point-center", "3-point-tangent", "3-point-tangent-start", "start-end-angle", "center-start-angle" or "center-radius-angles". If no type is specified then "center-radius-angles" is used.

layoutarray

An array of layout values for the arc dependent on the specified type. See below.

settingsobject

Additional settings for the arc.

asstring

The type to return. A value of "object" will return an object the contains the path, as well as extra information. A value of "string" (the default) will return the path alone.

sizebooleannumberstring

A size can be specified to draw a multi-radius closed arc. If a number is passed in then the value will be added to the layout radius. A string can be used to specify a percent (with a suffix of "%") or explicit radius (with a prefix of "="). The default value of false will not draw a size.

marginnumberobject

The margins to use on the arc. If a number is passed in then the value will be applied to all margins of the arc.

beforenumber

The margin to apply to the start angle of the arc.

afternumber

The margin to apply to the end angle of the arc.

innernumber

The margin to apply to the inner radius of the arc.

outernumber

The margin to apply to the outer radius of the arc.

drawLineToboolean

Whether or to draw a line ("L") to the start point of the arc or use the move ("M") operation (the default value of false).

Description

Generate an arc path.

Discussion

This method will generate an arc path definition from the passed in layout.

Layout types are "3-point-intersect", "3-point-center", "3-point-tangent", "3-point-tangent-start", "start-end-angle", "center-start-angle" or "center-radius-angles".

A "3-point-intersect" (or"3pi") will draw an arc that passes through the start and end points and intersects a third point. The layout requires (in order) a start point, intersect point and end point.

A "3-point-center" (or"3pc") will draw an arc that passes through the start and end points with the given center point. requires a layout with a start point, center point and end point.

A "3-point-tangent" (or"3pt") will draw an arc that passes through the start and end points and is tangent to a third point. The layout requires (in order) a start point, tangent point and end point.

A "3-point-tangent-start" (or"3pts") is much like the "3-point-tangent" only the tangent point is before the start point. The layout requires (in order) a tangent point, start point and end point.

A "start-end-angle" (or"sea") will draw an arc that passes through the start and end points and encompasses the specified angle. The layout requires (in order) a start point, end point, and a desired angle of the arc.

A "center-start-angle" (or"csa") will draw an arc that starts at a given point and using the center point traverses the given angle. The layout requires (in order) a center point, start point, and a desired angular difference from the start point.

A "center-radius-angles" (or"cra") will draw an arc that of the given center, radius, and start and end angles. The layout requires (in order) a center point, radius, start and end angles.

A point can either be an array with the "x" and "y" values, or an object with "x" and "y" properties. Angles must be numbers between -360 and 360 where 0 is the positive "x" axis. If two angles are used and the start angle is greater then the end angle then the arc will be drawn counter clockwise. A radius must be a positive number.